﻿using System;
using FU.Capstones.IMS.Web.Common;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.DataContracts;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.EventArgs;

namespace FU.Capstones.IMS.Web.Silverlight.Models
{
    public class ProductLoafImportModel: ModelBase
    {
        public ProductLoafImportModel()
        {
            client.GetEmployeeCollectionCompleted += DoGetEmployeeCollectionCompleted;
            client.GetProductCollectionCompleted += DoGetProductCollectionCompleted;
        }
      
        #region GetEmployeeCollection

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Employee>> GetEmployeeCollectionCompleted;
        void DoGetEmployeeCollectionCompleted(object sender, CollectionFeedbackCompletedEventArgs<Employee> e)
        {
            if (GetEmployeeCollectionCompleted != null)
            {
                GetEmployeeCollectionCompleted(sender, e);
            }
        }
        public int GetEmployeeCollectionAsync(bool isShowAll)
        {
            client.GetEmployeeCollectionAsync(isShowAll);
            return WebConstants.MagicNumer;
        }

        #endregion
        #region GetProductCollectionCompleted

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Product>> GetProductCollectionCompleted;
        void DoGetProductCollectionCompleted(object sender, CollectionFeedbackCompletedEventArgs<Product> e)
        {
            if (GetProductCollectionCompleted != null)
            {
                GetProductCollectionCompleted(sender, e);
            }
        }
        public int GetProductCollectionAsync(bool isShowAll)
        {
            client.GetProductCollectionAsync(isShowAll);
            return WebConstants.MagicNumer;
        }

        #endregion
    }
}
